<template>
	<view>
		detail01
		<navigator :delta="1" open-type="navigateBack">返回（组件方式）</navigator>
		<button @click="goback">返回</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			};
		},
		onLoad(options) {
			console.log('url',options);
			// 监听事件通道传过来的数据
			const eventChannel=this.getOpenerEventChannel()
			eventChannel.on('homepage',(data)=>{
				console.log('eventChannel',data);
			})
		},methods:{
			goback(){
				uni.navigateBack(
				{delta:1}
				)
				// 返回的时候传给home页面数据
				const eventChannel=this.getOpenerEventChannel()
				eventChannel.emit('detail01',{data:'我是detail01传过来的数据'})
				
			}
		}
	}
</script>

<style lang="scss">

</style>
